package cola.rh.System.common.security;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @Name: CustomUser
 * @Author: Cola
 * @Time: 2023/3/10 15:29
 * @Description: CustomUser
 */

public class CustomUser extends User {
    private cola.rh.System.Entity.User userEntity;

    public CustomUser(cola.rh.System.Entity.User userEntity, Collection<? extends GrantedAuthority> authorities) {
        super(userEntity.getUsername(), userEntity.getPassword(), authorities);
        this.userEntity = userEntity;
    }

    public cola.rh.System.Entity.User getUserEntity() {
        return userEntity;
    }

    public void setUserEntity(cola.rh.System.Entity.User userEntity) {
        this.userEntity = userEntity;
    }
}
